// class StoreRequest
//
// A store request which inherits 
//

#ifndef __STOREREQUEST_H__
#define __STOREREQUEST_H__

#include "base/DataRequest.h"
#include "util/Logger.h"

enum WritebackType {
    WB_NONE,     // just a store request, probably from processor
    WB_EVICTION, // line is being removed from the cache
    WB_FLUSH     // line is kept in cache
};

class StoreRequest : public DataRequest {
 public:
    NEW_DELETE_OPERATORS_H(StoreRequest,DataRequest);
    StoreRequest (VA addr,
                  Processor* p,
                  Entity* source,
                  Entity* dest,
                  uint dataSize,
                  uint headerSize = 0) :
        DataRequest(addr, p, source, dest, dataSize, headerSize),
        eviction(true),
        loaded(false),
        wbtype(WB_NONE) {};
        
    StoreRequest (const StoreRequest& sr);
    ~StoreRequest () {};    

    virtual const char* toString();

    // this is to tell if it is for eviction(no copy in cache anymore) or
    // flushing(keeping copy in cache) 
    WritebackType getWritebackType () const;
    void          setWritebackType (WritebackType);

    bool isLoaded ();
    void setLoaded (bool _b);

  private:
    bool eviction;
    bool loaded;
    WritebackType wbtype;
};

#endif // __STOREREQUEST_H__
